package com.ny.wlw;

public class Person {
    private String name;
    private int age;

    public void setAge(int age) {
        if (age < 0) {
            System.out.println("你输入的年龄是不对的");
        } else {
            this.age = age;
        }
    }

    public int getAge() {
        return age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void play() {

            System.out.println("正在玩游戏");

    }
}